# -*- coding: utf-8  -*-
#!/usr/local/bin/python

__author__ = 'jian.yao'

class CommodityOrderType(object):
    LAST_UPDATE         = 1
    CREATE_TIME         = 2
    NAME                = 3
    DEFAULT             = -LAST_UPDATE

    FIELDS              = {
                            LAST_UPDATE     : ('last_update',),
                            -LAST_UPDATE    : ("-last_update",),
                            CREATE_TIME     : ("create_time",),
                            -CREATE_TIME    : ("-create_time",),
                            NAME            : ("name"),
                            -NAME           : ("-name",),
                        }

class ChannelOrderType(object):
    LAST_UPDATE         = 1
    CREATE_TIME         = 2
    NAME                = 3
    DEFAULT             = -LAST_UPDATE

    FIELDS              ={
                            LAST_UPDATE     : ("last_update",),
                            -LAST_UPDATE    : ("-last_update",),
                            CREATE_TIME     : ("create_time",),
                            -CREATE_TIME    : ("-create_time",),
                            NAME            : ("name",),
                            -NAME           : ("-name",),
                        }

class RoleOrderType(object):
    LAST_UPDATE         = 1
    CREATE_TIME         = 2
    NAME                = 3
    CHANNEL             = 4
    DEFAULT             = -LAST_UPDATE

    FIELDS              = {
                            LAST_UPDATE     : ("last_update",),
                            -LAST_UPDATE    : ("-last_update",),
                            CREATE_TIME     : ("create_time",),
                            -CREATE_TIME    : ("-create_time",),
                            NAME            : ("name",),
                            -NAME           : ("-name",),
                            CHANNEL         : ("channel_id",),
                            -CHANNEL        : ("-channel_id",),
                        }

class RolePermissionOrderType(object):
    LAST_UPDATE         = 1
    ROLE                = 2
    MODULE              = 3
    METHOD              = 4
    DEFAULT             = -LAST_UPDATE

    FIELDS              = {
                            LAST_UPDATE     : ("last_update",),
                            -LAST_UPDATE    : ("-last_update",),
                            ROLE            : ("role_id",),
                            -ROLE           : ("-role_id",),
                            MODULE          : ("module",),
                            -MODULE         : ("-module",),
                            METHOD          : ("method",),
                            -METHOD         : ("-method",),
                        }

class AdminRoleOrderType(object):
    LAST_UPDATE         = 1
    ROLE                = 2
    USER                = 3
    DEFAULT             = -LAST_UPDATE

    FIELDS              = {
                            LAST_UPDATE     : ("last_update",),
                            -LAST_UPDATE    : ("-last_update",),
                            ROLE            : ("role_id",),
                            -ROLE           : ("-role_id",),
                            USER            : ("user_id",),
                            -USER           : ("-user_id",),
                        }


